package com.shopping.cart

import com.shopping.cart.Image
import com.shopping.cart.ItemCategory

class Item{
    Integer id
    String description
    BigDecimal amount
    String title
    Set categories = []
    List images = []
    static hasMany = [categories: ItemCategory, images: Image]

    static mapping = {
        cache  true
    }

    static constraints ={
        description maxSize:512, nullable: true
        amount nullable: false
        categories minSize:1
    }
}